package com.scpcfe.www.controller;

import com.scpcfe.www.entity.StudentInfoEntity;
import com.scpcfe.www.service.StudentInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
public class LoginDemo {
    @GetMapping("/login")   //同一个工程中，接口之间的虚拟路径要保证不同
    public void enter(String stuId) {
        List<StudentInfoEntity> entityList = StudentInfoService.studentInfoService.getStudentInfo(stuId);
        for (StudentInfoEntity entity : entityList) {
            System.out.println(entity.getStuName());
        }
        System.out.println(entityList.toString());

        List<StudentInfoEntity> ageList = StudentInfoService.studentInfoService.getStudentInfo(stuId);
        for (StudentInfoEntity entity : ageList) {
            System.out.println(entity.getStuName());
            System.out.println(entity.getAge());

        }
//    int result= StudentInfoService.studentInfoService.insertStudentInfo("21","志玛拥忠","22级人工智能1班");
//        System.out.println(result);
//    }
//        System.out.println(StudentInfoService.studentInfoService.updataStudentAge(stuId));
          System.out.println(StudentInfoService.studentInfoService.deletStudentInfo(stuId));
    }
}



